import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Layout from '../views/Layout.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '/',
        component: Home
      },
      {
        path: '/classift',
        component: () => import('../views/Classift.vue')
      },
      {
        path: '/discover',
        component: () => import('../views/Discover.vue')
      },
      {
        path: '/shopping',
        component: () => import('../views/Shopping.vue'),
        children: [
          {
            path: '/',
            component: () => import('.././views/shopping/shopping.vue')
          }
        ]
      },
      {
        path: '/center',
        component: () => import('../views/Center.vue'),
        children: [
          {
            path: '/',
            component: () => import('.././views/center/centerLayout.vue')
          }
        ]
      }

    ]
  },

  {
    path: '/search',
    component: () => import('../components/searchList.vue'),
    children: [
      {
        path: '/',
        name: 'list1',
        component: () => import('../components/searchList/searchList1.vue')
      },
      {
        path: '/list2',
        component: () => import('../components/searchList/searchList2.vue')
      },
      {
        path: '/list3',
        component: () => import('../components/searchList/searchList3.vue')
      }
    ]
  },

  {
    path: '/center/login',
    component: () => import('../components/login/Login.vue')
  },
  {
    path: '/particulars',
    component: () => import('../components/particulars/particulars.vue')
  },
  {
    path: '/center/set',
    component: () => import('../views/center/set.vue')
  },
  {
    path: '/center/head_data',
    component: () => import('../views/center/center_data.vue')
  }

]

const router = new VueRouter({
  routes
})

export default router
